From eb2c5fbb0fde508986d5e119e400d2a0d7d70496 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 8 Nov 2009 10:48:41 +0000 Subject: [PATCH] * tramp.texi (Auto-save and Backup): Disable backups just for a method. --- doc/misc/tramp.texi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 8b82c3638af..2c48fe32c55 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2057,6 +2057,23 @@ for @value{tramp} files: @end lisp @end ifset +@ifset emacs +It is also possible to disable backups depending on the used method. +The following code disables backups for the @option{su} and +@option{sudo} methods: + +@lisp +(setq backup-enable-predicate + (lambda (name) + (and (normal-backup-enable-predicate name) + (not + (let ((method (file-remote-p name 'method))) + (when (stringp method) + (member method '("su" "sudo")))))))) +@end lisp +@end ifset + + Another possibility is to use the @value{tramp} variable @ifset emacs @code{tramp-backup-directory-alist}. -- 2.30.2